//
//  FFHttpClientUtil.m
//  FFAirCompNetwork
//
//  Created by chewyong on 2017/6/8.
//  Copyright © 2017年 isoftstone. All rights reserved.
//

#import "FFHttpClientUtil.h"
#import <CommonCrypto/CommonDigest.h>

@implementation FFHttpClientUtil


+ (NSString*)getMD5WithData:(NSData *)data{
    const char* original_str = (const char *)[data bytes];
    unsigned char digist[CC_MD5_DIGEST_LENGTH]; //CC_MD5_DIGEST_LENGTH = 16
    CC_MD5(original_str, (uint)strlen(original_str), digist);
    NSMutableString* outPutStr = [NSMutableString stringWithCapacity:10];
    for(int  i =0; i<CC_MD5_DIGEST_LENGTH;i++){
        //小写x表示输出的是小写MD5，大写X表示输出的是大写MD5

        [outPutStr appendFormat:@"%02x",digist[i]];
    }
    
    return [outPutStr lowercaseString];
}


@end
